#pragma once

#include "Renderable.h"
#include "Collidable.h"
#include "../Common.h"

namespace DirectX
{
  class Mesh : public virtual IRenderable, public virtual ICollidable
  {
  public:
    Mesh(MeshDesc* data);
    virtual ~Mesh(void);

    virtual RenderDesc* GetRenderData();
    virtual XMMATRIX GetWorldMatrix();

    virtual void SetTranslation(float x, float y, float z);
    virtual void SetRotation(float x, float y, float z);

    bool RayAABBCollision(XMFLOAT3 rayOrigin,XMFLOAT3 rayDirection);

  protected:
    Mesh();

    bool indexed;
    XMFLOAT4X4 m_rotation, m_translation, m_transform;

    MeshDesc meshData;
    std::string m_texture;
    void UpdateTransformMatrix(bool updateAABB = false);
  };

}